class SubjectsController < ApplicationController

	def index
     @subjects = Subject.asc(:name)
   end

   def show
     @subject = Subject.find(params[:id])
   end

   def new
     @subject = Subject.new
   end

   def create
     @subject = Subject.new(params[:subject])
     @subject.save
     redirect_to @subject
   end

   def destroy
     @subject = Subject.find(params[:id])
     @subject.destroy
     redirect_to subjects_url
   end

   def destroy_all
     @subject = Subject.find(params[:id])
     @subject.destroy_all
     redirect_to subjects_url
   end



end
